package com.health.memberbackstage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.memberbackstage.mapper.SetmealDetailsMapper;
import com.health.memberbackstage.pojo.Checkgroup;
import com.health.memberbackstage.pojo.Checkitem;
import com.health.memberbackstage.pojo.SetmealDetails;
import com.health.memberbackstage.service.SetmealDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SetmealDetailsServiceImpl extends ServiceImpl<SetmealDetailsMapper,SetmealDetails> implements SetmealDetailsService {

    private final SetmealDetailsMapper setmealDetailsMapper;

    @Autowired
    public SetmealDetailsServiceImpl(SetmealDetailsMapper setmealDetailsMapper) {
        this.setmealDetailsMapper = setmealDetailsMapper;
    }

    @Override
    public int findSetmealInItemCount(Long id) {
        return setmealDetailsMapper.selectSetmealInItemCount(id);
    }

    @Override
    public List<Checkgroup> findCgNamesBySetmealID(Long id) {
        return setmealDetailsMapper.selectCgNamesBySetmealID(id);
    }

    @Override
    public List<String> findCINamesBySetmealID(Long id) {
        return setmealDetailsMapper.selectCINamesBySetmealID(id);
    }

    @Override
    public List<String> findCgRemarksBySetmealID(Long id) {
        return setmealDetailsMapper.selectCgRemarksBySetmealID(id);
    }
}
